{%- assign lpages=site.pages | where_exp:"page", "page contains 'lang'" | sort: 'lang' -%}

{%- assign content_template="layout_partials/language_nav_links.html" -%}
{%- if include.dropdown == true -%}
    {%- assign content_template="layout_partials/language_dropdown_option.html" -%}
{%- endif -%}
{%- if include.rel_alternate == true -%}
    {%- assign content_template="layout_partials/language_rel_alternate.html" -%}
{%- endif -%}

{% for l in lpages %}
    {%- assign local=site.langs[l.lang][l.lang] -%}
    {%- assign english=site.langs[l.lang]['en'] -%}
    {%- assign iso=l.lang -%}
    {%- assign url=l.url | absolute_url -%}
    {%- capture full -%}
        {{ local }}{% if l.lang_title %} ({{ english }}){% endif %}
    {%- endcapture -%}

    {% include {{ content_template }} %}
{% endfor %}